﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ServicioWebRest.Areas.Api.Models;

namespace ServicioWebRest.Areas.Api.Controllers
{
    public class ListasController : Controller
    {
        private ListaManager listaManager;

        public ListasController()
        {
            listaManager = new ListaManager();
        }

        [HttpGet]
        public JsonResult Listas(string usu)
        {
            return Json(listaManager.ObtenerLista(usu), JsonRequestBehavior.AllowGet);
        }

        static string GetStringValue()
        {
            return null;
        }


        public JsonResult Lista(string usu)
        {
            switch (Request.HttpMethod)
            {

                case "GET":
                    return Json(listaManager.ObtenerLista(usu), JsonRequestBehavior.AllowGet);
            }

            return Json(new { Error = true, Message = "Operación HTTP desconocida" });
        }

    }
}
